package com.ycy.state.life;

/**
 * 不用状态机
 */
public class MLifeBad {

  /**
   * 状态 open close run stop
   */
  public String state = "close";

  void open() {
    if ("close".equals(this.state)) {
      System.out.println("开启 。。。");
      this.state = "open";
    } else if ("open".equals(this.state)) {
      System.out.println("重复执行");
    } else if ("run".equals(this.state)) {
      System.out.println("运行中 不运行开启");
    } else if("stop".equals(this.state)){
      System.out.println("开启 。。。。");
    }
  }

  void close() {

  }

  void run() {

  }

  void stop() {

  }

  public static void main(String[] args) {
    MLifeBad mLifeBad = new MLifeBad();
    mLifeBad.open();
  }

}
